<template>
  <div class="change-order-container">
    <Title title="变更信息" style="margin-bottom: 17px;"/>
    <el-form
      ref="formRef"
      :rules="rules"
      class="lineHeight32"
      label-position="right"
      label-width="95px">
      <el-form-item prop="inputMode" label="填写模式">
        <div class="change-order-container-select">
          <selectWithoutHttp
            v-model="selectData"
            :list-data="inputModeOptions"
            placeholder="选择填写模式"
          />
          <div class="tip">
            <el-tooltip placement="top">
              <div slot="content">
                {{ selectData===1?
                  '填写补差值模式下，变更单直接填写与原订单的差额':
                  '填写实际值模式下，变更单直接填写订单的最终值'
                }}
              </div>
              <img :src="helpIcon" alt="">
            </el-tooltip>
          </div>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import Title from '@/components/Title';
import selectWithoutHttp from '@/components/Common/selectWithoutHttp';
import helpIcon from '@/assets/orderlist/help.png';
export default {
  components: { Title, selectWithoutHttp },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      helpIcon,
      inputModeOptions: [
        { id: 0, value: '填写实际值' },
        { id: 1, value: '填写补差值' }
      ],
      rules: {}
    };
  },
  computed: {
    selectData: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit('change', val);
      }
    }
  },
  methods: {
  }
};
</script>

<style lang="scss" scoped>
.change-order-container {
  padding: 24px 24px 0 24px;
}
.change-order-container-select {
  display: flex;
  align-items: center;
  .tip {
    color: #999;
    font-size: 13px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    img {
      width: 14px;
      cursor: pointer;
    }
  }
  &::v-deep {
    .el-select {
      width: 240px;
    }
  }
}
</style>
